package com.million.eduservice.client;

import com.million.commonutils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author: studyboy
 * @Date: 2022/3/31  9:14
 * 服务调用
 */
@FeignClient(value = "service-vod", fallback = VodClientFallbackService.class)
@Component
public interface VodClient {

    //调用service-vod 服务的删除视频的方法
    //根据视频id 删除视频
    //注意这里的PathVariable 需要指明参数，要不然会报错
    @DeleteMapping("/eduvod/upVod/deleteVod/{id}")
    public R deleteVod (@PathVariable("id") String id);

    //根据课程id 删除该课程下的所有视频，用List  来封装视频id，方便删除
    @DeleteMapping("/eduvod/upVod/removeAllVod")
    public R removeAllVod (@RequestParam("videoList") List<String> videoList);

}
